/*
* author : douyu
* date : 2024/1/5 11:49
* description : event_bus_type
*/

import 'package:event_bus/event_bus.dart';
import 'package:flutter_android_tv/Routes/Model/source_category_model.dart';
import '../Model/source_info_model.dart';

EventBus eventBus = EventBus();

class ChangeSourceMenuEvent {
  /// 是否选中一级菜单
  bool isChooseCategory;

  ChangeSourceMenuEvent(this.isChooseCategory);

}

/// 切换频道事件
class ChangePlaySourceEvent {
  /// 当前播放的索引值
  SourceInfoModel iptvSourceModel;
  /// 设置默认值为 0
  late int playIndex;

  ChangePlaySourceEvent(this.iptvSourceModel,{int index = 0}){
    playIndex = index;
  }
}

class ChangeSecondarySourceEvent {
  /// 当前选中模型
  SourceCategoryModel categoryModel;
  /// 切换完成是否要立即播放
  late bool isShouldPlay;

  ChangeSecondarySourceEvent(this.categoryModel,{bool shouldPlay = false}){
    isShouldPlay = shouldPlay;
  }
}

/// 是否展示侧边栏
class SlideShowChangeEvent{
  bool isShowSlide;

  SlideShowChangeEvent(this.isShowSlide);
}

/// 侧边栏展示选中index
class SlideChangeWithIndexEvent {
  /// 当前选中的index
  int categoryIndex;

  int secondaryIndex;

  SlideChangeWithIndexEvent(this.categoryIndex, this.secondaryIndex);
}

/// 退出App
class ShowQuitDialogEvent {

  ShowQuitDialogEvent();
}